load("//tools/build_defs/android:fb_xplat_android_cxx_library.bzl", "fb_xplat_android_cxx_library")
load("//tools/build_defs/oss:profilo_defs.bzl", "profilo_path")

APP_SPECIFIC_IS_ASSET_FLAG = {}

fb_xplat_android_cxx_library(
    name = "external_api",
    srcs = [
        "ExternalApi.cpp",
    ],
    header_namespace = "profilo",
    exported_headers = [
        "ExternalApi.h",
    ],
    can_be_asset = APP_SPECIFIC_IS_ASSET_FLAG.get(
        read_config("fbandroid", "app_mode"),
        True,
    ),
    force_static = True,
    labels = [],
    link_style = "shared",
    preferred_linkage = "static",
    visibility = [
        "PUBLIC",
    ],
    deps = [
        ":external_api_glue",
    ],
)

fb_xplat_android_cxx_library(
    name = "external_api_header",
    header_namespace = "profilo",
    exported_headers = ["ExternalApi.h"],
    force_static = True,
    labels = [],
    visibility = [
        profilo_path("..."),
    ],
    deps = [
        ":external_api_glue",
    ],
)

fb_xplat_android_cxx_library(
    name = "external_api_glue",
    srcs = [
        "ExternalApiGlue.cpp",
    ],
    header_namespace = "profilo",
    exported_headers = [
        "ExternalApiGlue.h",
    ],
    can_be_asset = APP_SPECIFIC_IS_ASSET_FLAG.get(
        read_config("fbandroid", "app_mode"),
        True,
    ),
    labels = [],
    link_style = "shared",
    soname = "libprofiloextapi.$(ext)",
    visibility = [
        profilo_path("..."),
    ],
)
